//获取缩略语
function displayAbbreviations(){
    let abbreviations = document.getElementsByTagName("abbr")
    if(abbreviations.length < 1){
        return false
    }
    let defs = new Array()
    for(let i=0;i<abbreviations.length;i++){
        let current_abbr = abbreviations[i]
        if(current_abbr.childNodes.length<1){   //处理iE浏览器下不解析abbr节点元素
            continue
        }
        let dedinition = current_abbr.getAttribute("title")
        let key = current_abbr.lastChild.nodeValue
        defs[key] = dedinition
    }
    // console.log('defs:',defs)

    //创建标记
    let dList = document.createElement("dl")
    for(key in defs){
        let definition = defs[key]
        //创建dt
        let dTitle = document.createElement("dt")
        let dTitle_text = document.createTextNode(key)
        dTitle.appendChild(dTitle_text)
        //创建dd
        let dDesc = document.createElement("dd")
        let dDesc_text = document.createTextNode(definition)
        dDesc.appendChild(dDesc_text)
        dList.appendChild(dTitle)
        dList.appendChild(dDesc)
    }
    //创建标题
    let header = document.createElement("h2")
    let header_text = document.createTextNode("Abbreviations")
    header.appendChild(header_text)
    //将标题和标记渲染到body中
    document.body.appendChild(header)
    document.body.appendChild(dList)
}
    addLoadEvent(displayAbbreviations)